<template>
	<view>
		<nav-custom></nav-custom>
		<swiper class="banner" indicator-dots >
			<swiper-item>
				<view class="swiper-item">
					<image src="https://mcake-oss.oss-cn-hangzhou.aliyuncs.com/file/52050d9a9cea1f4d/cf56f5871b02f1bf.jpg" mode="aspectFill"></image>
				</view>
			</swiper-item>
			<swiper-item>
				<view class="swiper-item">
					<image src="https://mcake-oss.oss-cn-hangzhou.aliyuncs.com/file/468d639118a1b0c6/d50694339ea896e1.jpg" mode="aspectFill"></image>
				</view>
			</swiper-item>
		</swiper>
		<view class="goods-list flex flex-wrap justify-between">
			<goods-item 
				v-for="item in cakeList" 
				:gdata="item" 
				:key="item.objectId"
			/>
		</view>
	</view>
</template>

<script>
	import { cakeGet } from '../../api/cake';
import Test  from '../../components/test.vue'
	export default {
		components:{
			Test
		},
		data() {
			return {
				cakeList:[]
			}
		},
		methods: {
			
		},
		onLoad() {
			console.log('页面的onLoad');
			cakeGet().then(res=>{
				this.cakeList = res.data.results
			})
		}
	}
</script>

<style lang="scss">
.banner{
	// border: 1px solid red;
	height: 800upx;
	image{
		width: 750upx;
		height: 800upx;
	}
}
</style>
